<script>
function confirmDelete( id ) {
	Sexy.confirm('Esta segur@ que quiere eliminar este registro?', {onComplete: 
		function(returnvalue) { 
            if(returnvalue) {
              	Sexy.info('Registro eliminado con exito');
              	location.href= "/CmsPanel/node/delete/id/" + id;
            } else{
            	return false;
        	}
    	}
	});
}
$(document).ready( function (){
    $('#content_type_id').change(function{
        alert($('#content_type_id').value); 
    });
});
</script>

<h3>Contenido</h3>

<? if (count($this->paginator)): ?>
 
 <table class="fullwidth" border="0" cellpadding="0" cellspacing="0">
    <thead>
      <tr>
		<th>ID</th>
        <th>Tipo </th>
        <th>Titulo</th>
        <th></th>
      </tr>
    </thead>

    <tbody>
        <? $i=0; foreach ($this->paginator as $node) : ?>
        <tr class=<?php echo ($i%2==0?'"even"':'"odd"') ?>>
          <td><?=$node['node_id']; ?></td>
          <td><?=$node['type'] ?></td>
          <td><?=$node['title'] ?></td>
          <td>
			<?php echo $this->href( "node", "update", "Editar", array( "nid" => $node['node_id'], 'cyid' => $node['content_type_id'] ) ) ?>
          	| <a href="#" onclick="confirmDelete( <?=$node['node_id']?>);return false;" >Borrar</a>
          </td>
        </tr>
        <? $i++; endforeach; ?>
    </tbody>
</table>
<?php echo $this->paginator ?>
<? endif; ?>
<p>
<?php echo $this->href( "node", "create", "Crear un nuevo contenido" ) ?>
</p>

